<?php $_REQUEST['page'] = $_REQUEST['page'] ?? 1;?>
@if ($news_list->hasPages())
    <div class="overflow columnspage ftc">
        @if ($news_list->onFirstPage())
        <a href="{{route('maps' ,['cls_id' => $cls_id])}}&page={{$news_list->currentPage() - 1}}" class="inblock ftc c3838 pageup"><em> << </em>上一页 </a>
        @endif
            @for ($i = 1; $i <= $news_list->lastPage(); $i++)
            <a href="{{route('maps' ,['cls_id' => $cls_id])}}&page={{$i}}" class="inblock ft14 ftc c3838 {{$_REQUEST['page'] == $i ? 'pagedefalut' : ''}}">{{$i}}</a>
            @endfor
            @if($news_list->hasMorePages())
            <a href="{{route('maps' ,['cls_id' => $cls_id])}}&page={{$news_list->currentPage() + 1}}" class="inblock ftc c3838 pagedown">下一页 <em> >> </em></a>
            @endif
        <span class="ft14">跳转至&ensp;</span>
        <input class="tiaozhuanpage ftc" type="text" name="" id="pageNum" value="" />
        <span class="ft14">&ensp;页</span>
        <a href="javascript:void(0);" class="inblock sumibtn cfff ft14 ml5"  id="goPage">确认</a>
    </div>


    <script>
        //pageLocation
        window.onload = function () {
            $('#goPage').on('click' , function(){
                var page = $('#pageNum').val();
                if ( !page.match(/[0-9]*/)){
                    alert('页码无效');
                    return ;
                }
                window.location.href = '{{route('maps' , $cls_id)}}&page=' + $('#pageNum').val() + '&cls_id=' + '{{$cls_id}}';
            })
        }
    </script>
@endif